/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package smartgrid;

import java.util.List;
import org.hibernate.criterion.DetachedCriteria;
import org.orm.PersistentSession;
import org.orm.criteria.*;

public class PriceDetachedCriteria extends AbstractORMDetachedCriteria {
	public final IntegerExpression ID;
	public final IntegerExpression StartHour;
	public final IntegerExpression StartMinute;
	public final FloatExpression Euros;
	public final IntegerExpression EndHour;
	public final IntegerExpression EndMinute;
	
	public PriceDetachedCriteria() {
		super(smartgrid.Price.class, smartgrid.PriceCriteria.class);
		ID = new IntegerExpression("ID", this.getDetachedCriteria());
		StartHour = new IntegerExpression("StartHour", this.getDetachedCriteria());
		StartMinute = new IntegerExpression("StartMinute", this.getDetachedCriteria());
		Euros = new FloatExpression("Euros", this.getDetachedCriteria());
		EndHour = new IntegerExpression("EndHour", this.getDetachedCriteria());
		EndMinute = new IntegerExpression("EndMinute", this.getDetachedCriteria());
	}
	
	public PriceDetachedCriteria(DetachedCriteria aDetachedCriteria) {
		super(aDetachedCriteria, smartgrid.PriceCriteria.class);
		ID = new IntegerExpression("ID", this.getDetachedCriteria());
		StartHour = new IntegerExpression("StartHour", this.getDetachedCriteria());
		StartMinute = new IntegerExpression("StartMinute", this.getDetachedCriteria());
		Euros = new FloatExpression("Euros", this.getDetachedCriteria());
		EndHour = new IntegerExpression("EndHour", this.getDetachedCriteria());
		EndMinute = new IntegerExpression("EndMinute", this.getDetachedCriteria());
	}
	
	public TariffDetachedCriteria createTariff_Prices_roleCriteria() {
		return new TariffDetachedCriteria(createCriteria("Tariff_Prices_role"));
	}
	
	public Price uniquePrice(PersistentSession session) {
		return (Price) super.createExecutableCriteria(session).uniqueResult();
	}
	
	public Price[] listPrice(PersistentSession session) {
		List list = super.createExecutableCriteria(session).list();
		return (Price[]) list.toArray(new Price[list.size()]);
	}
}

